﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Warehouse1 : Form
    {
        public Warehouse1()
        {
            InitializeComponent();
        }

        private void 添加ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Warehouse2 form9 = new Warehouse2();

            form9.Show();
        }

        private void Form8_Load(object sender, EventArgs e)
        {
            string sql = "select * from Depot";
            DataTable dt = DBHelper.Select(sql);
            dataGridView1.DataSource = dt;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sql = $"select * from Depot where DName='{comboBox1.Text}'";
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = DBHelper.Select(sql);
        }
    }
}
